<template>
    <div>
        <el-descriptions title="客户详细信息">
            <el-descriptions-item label="客户名称">{{name}}</el-descriptions-item>
            <el-descriptions-item label="负责人">{{mainperson}}</el-descriptions-item>
            <el-descriptions-item label="负责人电话">{{tel}}</el-descriptions-item>
            <el-descriptions-item label="办公地址">{{address}}</el-descriptions-item>
            <el-descriptions-item label="游戏">{{email}}</el-descriptions-item>
            <el-descriptions-item label="经营范围">{{scope}}</el-descriptions-item>
        </el-descriptions>

        <el-button @click="onSubmit">确认</el-button>
    </div>
</template>

<script>
    export default {
        name: "SelectClient",

        data() {
            return {
                customid: '',
                mainperson: '',
                tel: '',
                address: '',
                email: '',
                scope: '',
                customname: '',
                phone: '',
                boss: '',
                name:'',

            }
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                let customid = this.$store.state.customid
                let url = 'api/custom/getById?id='+customid
                this.$axios.get(url).then(r => {

                    console.log(r.data)
                    let datas = r.data
                    this.name = datas.customname
                    this.mainperson = datas.boss
                    this.tel = datas.phone
                    this.address = datas.address
                    this.email = datas.email
                    this.scope = datas.scope
                })
            },
            onSubmit() {
                this.$router.push("CustomerView")
            }
        }
    }
</script>

<style scoped>

</style>